import instance from '../utils/request.js'

export function userinfomyApi () {
  return instance({
    url: '/v1_0/user',
    method: 'GET',
    needToken: true,
    headers: { 'Content-Type': 'application/json' }
  })
}
export function edituserinfoApi () {
  return instance({
    url: '/v1_0/user/profile',
    method: 'PATCH',
    needToken: true,
    headers: { 'Content-Type': 'application/json' }
  })
}
export function dialogApi (data) {
  const fd = new FormData()
  fd.append('photo', data)
  return instance({
    url: '/v1_0/user/photo',
    method: 'PATCH',
    needToken: true,
    data: fd
  })
}

export function mysaveApi (data) {
  return instance({
    url: '/v1_0/user/profile',
    method: 'PATCH',
    data: data,
    needToken: true,
    headers: { 'Content-Type': 'application/json' }
  })
}
